package chixing.day15;

public class MathDemo {
    public static void main(String[] args) {
        int min = Math.min(10,20);
        int max = Math.max(10,20);
        int abs = Math.abs(-9);
        System.out.println(Math.round(9.4));//四舍五入
        System.out.println(Math.ceil(9.1));//向上取整
        System.out.println(Math.floor(9.1));//向下取整
        System.out.println(Math.random());//随即输出[0.0,1.0)
        //0-100随机整数int
        System.out.println((int) (Math.random() * 101));
        //160-270随机整数int
        int b = (int)(Math.random() *(270-160+1)+160);
        System.out.println(b);
        //50-100随机整数int
        System.out.println((int) (Math.random() * (50 + 1) + 50));
        //150-300
        System.out.println((int)(Math.random() * 151 + 150));
    }
}
